package com.dragon.modules.yuegou.query.live;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dragon.modules.yuegou.entity.live.BroadcastSpuEntity;
import com.dragon.modules.yuegou.mybatis.Condition;
import com.dragon.modules.yuegou.mybatis.Query;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonUnwrapped;

/**
 * 商品直播间关系表 动态查询条件
 * 
 * @author ZSH
 * @date 2020-06-12 11:15:02
 * @version 2.0
 */
@JsonInclude(Include.NON_NULL)
public class BroadcastSpuQuery extends BroadcastSpuEntity implements Query<BroadcastSpuEntity> {


    /** Id查询条件 */
	@JsonUnwrapped(prefix = "id")
	private Condition<String> idCondition;

    /** 审核商品Id查询条件 */
	@JsonUnwrapped(prefix = "reviewId")
	private Condition<String> reviewIdCondition;

    /** 直播间Id查询条件 */
	@JsonUnwrapped(prefix = "broadcastId")
	private Condition<String> broadcastIdCondition;

    /** 微信直播间id查询条件 */
	@JsonUnwrapped(prefix = "roomId")
	private Condition<String> roomIdCondition;

	/**
	 * 构造一个查询条件对象
	 */
	public BroadcastSpuQuery() {
		super();
	}

	/**
	 * 依据实体对象构造一个查询条件对象
	 * 
	 * @param entity 实体对象
	 */
	public BroadcastSpuQuery(BroadcastSpuEntity entity) {
		super(entity);
	}

	/**
	 * 依据其它查询条件对象的信息构造一个查询条件对象
	 * 
	 * @param other 查询条件对象
	 */
	public BroadcastSpuQuery(BroadcastSpuQuery other) {
		super(other);
		if(other.idCondition != null) {
			this.idCondition = other.idCondition.copy();
		}
		if(other.reviewIdCondition != null) {
			this.reviewIdCondition = other.reviewIdCondition.copy();
		}
		if(other.broadcastIdCondition != null) {
			this.broadcastIdCondition = other.broadcastIdCondition.copy();
		}
		if(other.roomIdCondition != null) {
			this.roomIdCondition = other.roomIdCondition.copy();
		}
	}

	@Override
	public QueryWrapper<BroadcastSpuEntity> toQueryWrapper() {
		QueryWrapper<BroadcastSpuEntity> wrapper = new QueryWrapper<>(this);
		if (idCondition != null) {
			idCondition.toWrapper(wrapper, COL_ID);
		}
		if (reviewIdCondition != null) {
			reviewIdCondition.toWrapper(wrapper, COL_REVIEW_ID);
		}
		if (broadcastIdCondition != null) {
			broadcastIdCondition.toWrapper(wrapper, COL_BROADCAST_ID);
		}
		if (roomIdCondition != null) {
			roomIdCondition.toWrapper(wrapper, COL_ROOM_ID);
		}
		return wrapper;
	}

	/**
	 * 构造并返回Id查询条件
	 * 
	 * @return idCondition Id查询条件
	 */
	public Condition<String> id() {
		this.idCondition = new Condition<>();
		return this.idCondition;
	}
	
	/**
	 * 获取Id查询条件
	 * 
	 * @return idCondition Id查询条件
	 */
	public Condition<String> getIdCondition() {
		return idCondition;
	}

	/**
	 * 设置Id查询条件
	 * 
	 * @param idCondition Id查询条件
	 */
	public void setIdCondition(Condition<String> idCondition) {
		this.idCondition = idCondition;
	}

	/**
	 * 构造并返回审核商品Id查询条件
	 * 
	 * @return reviewIdCondition 审核商品Id查询条件
	 */
	public Condition<String> reviewId() {
		this.reviewIdCondition = new Condition<>();
		return this.reviewIdCondition;
	}
	
	/**
	 * 获取审核商品Id查询条件
	 * 
	 * @return reviewIdCondition 审核商品Id查询条件
	 */
	public Condition<String> getReviewIdCondition() {
		return reviewIdCondition;
	}

	/**
	 * 设置审核商品Id查询条件
	 * 
	 * @param reviewIdCondition 审核商品Id查询条件
	 */
	public void setReviewIdCondition(Condition<String> reviewIdCondition) {
		this.reviewIdCondition = reviewIdCondition;
	}

	/**
	 * 构造并返回直播间Id查询条件
	 * 
	 * @return broadcastIdCondition 直播间Id查询条件
	 */
	public Condition<String> broadcastId() {
		this.broadcastIdCondition = new Condition<>();
		return this.broadcastIdCondition;
	}
	
	/**
	 * 获取直播间Id查询条件
	 * 
	 * @return broadcastIdCondition 直播间Id查询条件
	 */
	public Condition<String> getBroadcastIdCondition() {
		return broadcastIdCondition;
	}

	/**
	 * 设置直播间Id查询条件
	 * 
	 * @param broadcastIdCondition 直播间Id查询条件
	 */
	public void setBroadcastIdCondition(Condition<String> broadcastIdCondition) {
		this.broadcastIdCondition = broadcastIdCondition;
	}

	/**
	 * 构造并返回微信直播间id查询条件
	 * 
	 * @return roomIdCondition 微信直播间id查询条件
	 */
	public Condition<String> roomId() {
		this.roomIdCondition = new Condition<>();
		return this.roomIdCondition;
	}
	
	/**
	 * 获取微信直播间id查询条件
	 * 
	 * @return roomIdCondition 微信直播间id查询条件
	 */
	public Condition<String> getRoomIdCondition() {
		return roomIdCondition;
	}

	/**
	 * 设置微信直播间id查询条件
	 * 
	 * @param roomIdCondition 微信直播间id查询条件
	 */
	public void setRoomIdCondition(Condition<String> roomIdCondition) {
		this.roomIdCondition = roomIdCondition;
	}

}
